package com.ruoyi.warning.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.warning.domain.entity.WirelessBoardApxy;
import com.ruoyi.warning.domain.vo.WirelessBoardApxyVO;
import com.ruoyi.warning.mapper.WirelessBoardApxyMapper;
import com.ruoyi.warning.service.IWirelessBoardApxyService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 无线画板ap位置 服务实现类
 * </p>
 *
 * @author chenhc
 * @since 2025-10-22
 */
@Service
public class WirelessBoardApxyServiceImpl extends ServiceImpl<WirelessBoardApxyMapper, WirelessBoardApxy> implements IWirelessBoardApxyService {

    @Resource
    private WirelessBoardApxyMapper wirelessBoardApxyMapper;

    @Override
    public Object resetXY(List<Integer> list) {
        LambdaUpdateWrapper<WirelessBoardApxy> wrapper = new UpdateWrapper<WirelessBoardApxy>().lambda()
                .in(WirelessBoardApxy::getId,list).set(WirelessBoardApxy::getX,null).set(WirelessBoardApxy::getY,null);
        return this.update(wrapper);
    }

    @Override
    public Object getDrawingBoardTopology(Integer id) {
        List<WirelessBoardApxy> list = this.list(new LambdaQueryWrapper<WirelessBoardApxy>()
                .eq(WirelessBoardApxy::getBroadId,id));
        List<WirelessBoardApxyVO> list1 = wirelessBoardApxyMapper.getDrawingBoardTopology(id);
        return list1;
    }
}
